<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 联系人</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="__PUBLIC__/admin/favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/js/plugins/iCheck/custom.css" rel="stylesheet">
    <!--<link href="__PUBLIC__/admin/js/layui/css/layui.css" rel="stylesheet">-->

</head>
<include file="Admin@Index:cache" />
<body class="gray-bg contacts" oncopy="copyval()">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-content">
                    <h2>信息中心</h2>

                    <!--<div class="input-group">-->
                    <!--<form type="get" enctype="multipart/form-data" action="__SELF__">-->
                    <!--<input type="text" placeholder="请输入手机号" name="content" id="content" class="input form-control">-->
                    <!--<div class="input-group-btn">-->
                    <!--<bottom style="height: 2.8rem;"  id="search" type="submit" class="btn btn btn-primary"><i class="fa fa-search"></i> 搜索</bottom>-->
                    <!--</div>-->
                    <!--</form>-->
                    <!--</div>-->
                    <div class="col-sm-12" style="margin-bottom: 1rem">
                        <form role="form" action="__SELF__" method="get">
                            <div class="form-group">
                                <!--<label>商品code</label>-->
                                <input type="text" id="content" placeholder="" name="content" class="form-control">
                            </div>
                            <div>
                                <!--<div class="layui-inline">-->
                                    <input style="height: 2.5rem;" class="laydate-icon" placeholder="起始时间" id="start" name="start">       <input style="height: 2.5rem;" class="laydate-icon" placeholder="截止时间" id="end" name="end">
                                <!--</div>-->

                                <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit" id="search"><strong>搜索</strong>
                                </button>

                            </div>
                        </form>
                    </div>
                    <br>
                    <table class="table table-striped table-hover">
                        <tbody>
                        <tr>
                            <th>标题</th>
                            <th style="width: 50%">内容</th>
                            <th>发送时间</th>
                            <!--<th>用户账号</th>-->
                            <th>用户真名</th>
                            <th>
                                <div class="btn-group">
                                    <div data-toggle="dropdown" >信息类型<button type="button" style="background-color: #f9f9f9;border: none;"><span class="caret"></span></button></div>
                                    <ul class="dropdown-menu dropdown-menu-right">
                                        <li><a href="__MODULE__/Message/user_news">全部</a></li>
                                        <li><a href="__MODULE__/Message/user_news/type/1">个人信息</a></li>
                                        <li><a href="__MODULE__/Message/user_news/type/2">群信息</a></li>
                                    </ul>
                                </div>
                            </th>

                            <!--<th class="client-status">操作</th>-->

                        </tr>
                        <foreach name="list" item="list">
                            <tr>
                                <td><{$list.title}></td>
                                <td><{$list.content}></td>
                                <td>
                                    <{$list.ctime}>
                                </td>
                                <!--<td>-->
                                        <!--<{$list.mobile}>-->
                                <!--</td>-->
                                <td><{$list.truename}></td>
                                <td>
                                    <switch name="list.type">
                                        <case value="1">个人信息</case>
                                        <case value="2">群信息</case>
                                    </switch>
                                </td>

                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <ul class="pagination">
                        <if condition="$tol gt 10">
                        <{$fpage}>
                            </if>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/admin/js/layer/layer.js"></script>
<script src="__PUBLIC__/admin/js/layui/layui.js"></script>
<script src="__PUBLIC__/admin/js/layui/lay/modules/laydate.js"></script>
<!--<script src="__PUBLIC__/admin/js/layui/lay/dest/layui.all.js"></script>-->
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/admin/js/plugins/fancybox/jquery.fancybox.js"></script>

<script>
    $(document).ready(function () {
        $('.contact-box').each(function () {
            animationHover(this, 'pulse');
        });
    });

    function reply(id){
        html='';
        html+='<div class="modal-body" id="lists" style="height:100%">';
        html+='<form class="form-horizontal">';
        html+='<div class="form-group">';
        html+='<div class="col-sm-12">';
        html+='<textarea style="height:10rem" type="text" id="content" placeholder="请填写回复内容" class="form-control"></textarea>';
        html+='</div>';
        html+='</div>';
        html+='</form>';
        html+='<div class="modal-footer" style="border:0">';
        html+='<a href="javascript:void(0);" onclick="layer.closeAll()" type="button" class="btn btn-default" >关闭</a>';
        html+='<a href="javascript:void(0);" onclick="replys(\''+id+'\');" type="button" class="btn btn-primary" >回复</a>';
        html+='</div>';
        html+='</div>';

        layer.open({
            type: 1, //Page层类型
            area: ['530px', '270px'],
            title: '回复用户反馈',
            shade: 0.6, //遮罩透明度
            maxmin: true, //允许全屏最小化
            anim: 1, //0-6的动画形式，-1不开启
            content: html
        });
    }
    function replys(id){
        var content=$('#content').val();
        if(content==''){
            layer.msg('回复内容不能为空',{icon:5,time:2000});
            return false;
        }
        layer.load(2);
//        layer.confirm('是否确定推送信息？',function(){
            $.post('__MODULE__/Message/reply_feedback',{id:id,content:content},function(data){
                layer.closeAll('loading');
                if(data.code=='1001'){
                    window.location.reload();
                }else{
                    if(data.status=='0'){
                        layer.msg(data.info,{time:2000,icon:5});
                    }else{
                        layer.msg(data.result,{time:2000,icon:5});
                    }
                }
            });
//        });
    }

    $(document).ready(function () {
        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    });

    layui.use('laydate', function(){
        var laydate = layui.laydate;
        var start = {
//            elem:'#start',
//            min: laydate.now(),
//            max: '2099-06-16 23:59:59',
//            istime: false,
//            format: 'YYYY-MM-DD hh:mm:ss',
            choose:function(dates){
                end.min = dates; //开始日选好后，重置结束日的最小日期
                end.start = dates; //将结束日的初始值设定为开始日
//                layer.msg(dates);
//                var show=$('#dates').val();
//                var res=show+','+dates;
//                $('#dates').val(res);
            }
        };
        var end = {
//            elem:'#end',
//            min: laydate.now(),
//            max: '2099-06-16 23:59:59',
//            istime: false,
//            format: 'YYYY-MM-DD hh:mm:ss',
            choose:function(dates){
                start.max = dates; //结束日选好后，重置开始日的最大日期
//                layer.msg(dates);
//                var show=$('#dates').val();
//                var res=show+','+dates;
//                $('#dates').val(res);
            }
        };

        document.getElementById('start').onclick = function(){
//            layer.alert(123);
            start.elem = this;
            laydate(start);
        }
        document.getElementById('end').onclick = function(){
//            layer.alert(123);
            end.elem = this;
            laydate(end);
        }
    });
    function copyval() {
//        event.returnValue = false;
        var content = window.getSelection().toString();
        $.post('__MODULE__/Mypublic/copy_all', {content:content}, function (data) {
            if (data.code == '1001') {
            } else {
                console.log(data);
            }
        });
//        console.log(content)
    }

</script>


</body>

</html>
